/*----------------------------------------------------------------------------
Owner(s): Shane Whitfield
$Copyright: $
$Id: 

Purpose  : The node mgr updates all node connections and lets the go know which 
			gos are connected.
----------------------------------------------------------------------------*/

#pragma once

#include "singleton.h"
#include "subsystem.h"

/*--------------------------------------------------------------------------*/
// Forward declaration.
class CGoNode;

/*--------------------------------------------------------------------------*/
// Class CNodeMgr declaration.
class CNodeMgr : public TSingleton<CNodeMgr>, public CSubsystem
{
	typedef CSubsystem super;

public:
					CNodeMgr();
				
	//Subsystem overrides
	virtual void	OnPostWorldUpdate();
	virtual void	OnPostWorldUnload();
	
	void			RegisterRootNode(CGoNode* i_rootNode);
	
	struct SNode
	{
					SNode(CGoNode* i_go) {
						 Go = i_go; Visited = false; }
		CGoNode*	Go;
		bool		Visited;
	};
			
private:

	CGoNode*	m_rootNode;
};

inline CNodeMgr& CNodeMgr_GetSingleton() { return CNodeMgr::GetSingleton(); }
#define g_nodemgr (CNodeMgr_GetSingleton())

/*-----------------------------------EOF!-----------------------------------*/